Learn Html5 and JavaScript for Android by Gavin Williams

Learn Html5 and JavaScript for Android by Gavin Williams

Author:Gavin Williams [Williams, Gavin]
Language: eng
Format: epub
Tags: Computers, Hardware, Web, Handheld Devices, Web Programming
ISBN: 9781430243472
Publisher: Apress
Published: 2012-06-20T04:00:00+00:00


var handleLocationError = function(error){

alert(error.message);

}

navigator.geolocation.getCurrentPosition(showCurrentPosition,

handleLocationError);

</script>

The result can be seen in Figure 7-3. You can, of course, also subscribe to significant changes to the user’s current position. You can do this with the navigator.geolocation.watchPosition method. This will listen for significant changes to the user’s current position, and call a callback function every time the user’s position changes. The watchPosition method takes the same parameters as the getCurrentPosition method.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.